﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using IceBird;
using System.Xml.Serialization;

namespace Classes
{
	/*[Serializable]
	public class Group : IceBird.Group
	{
		public Group() { }
		public Group(SqlDataReader reader)
		{
			id = (int)reader[0];
			if (reader[1] != null)
				name = (string)reader[1];
			topicCnt = (int)reader[2];
		}
		override public string ToString()
		{
			return
				id.ToString() + " " +
				name + " " +
				topicCnt.ToString();
		}
	}

	[Serializable]
	public class Topic : IceBird.Topic
	{
		public Topic() { }
		public Topic(SqlDataReader reader)
		{
			id = (int)reader[0];
			groupId = (int)reader[1];
			title = (string)reader[2];
			time = (DateTime)reader[3];
			userId = (int)reader[4];
			idInGroup = (int)reader[5];
			replyCnt = (int)reader[6];
		}
		override public string ToString()
		{
			return
				id.ToString() + " " +
				groupId.ToString() + " " +
				title + " " +
				time.ToString() + " " +
				userId.ToString() + " " +
				idInGroup.ToString() + " " +
				replyCnt.ToString();
		}
	}

	[Serializable]
	public class Message : IceBird.Message
	{
		public Message(SqlDataReader reader)
		{
			id = (int)reader[0];
			userId = (int)reader[1];
			time = (DateTime)reader[2];
			topicId = (int)reader[3];
			content = (string)reader[4];
			idInTopic = (int)reader[5];
		}
		override public string ToString()
		{
			return
				id.ToString() + " " +
				userId.ToString() + " " +
				time.ToString() + " " +
				topicId.ToString() + " " +
				content.ToString() + " " +
				idInTopic.ToString();
		}
	}*/
	[Serializable]
	public class AssignResult
	{
		public AssignState assignState;
		public int userId;
		public AssignResult() { }
		public AssignResult(IceBird.AssignState assignSt)
		{
			assignState = assignSt;
			userId = 0;
		}
		public AssignResult(int id)
		{
			assignState = IceBird.AssignState.SUCCEED;
			userId = id;
		}
	}

	[Serializable]
	public class CreateResult
	{
		public IceBird.CreateState createState;
		public int id;
		public CreateResult() { }
		public CreateResult(IceBird.CreateState createSt)
		{
			createState = createSt;
			id = 0;
		}
		public CreateResult(int Id)
		{
			createState = IceBird.CreateState.Pass;
			id = Id;
		}
	}
}